package com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.internetofthings.firefightingiot;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseService;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.utils.requestutil.HttpRequestUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @Author: YangYu
 * @ClassName: DeviceSwitchService
 * @Date: Created in 9:43 2023/2/20
 * @Description: 开关量服务
 */
@Service
@Slf4j
public class DeviceSwitchService extends BaseService {

    /**
     * @Author YangYu
     * @Description 开关列表
     * @Date Created in 17:14 2022/10/10
     * @Param [jsonParam]
     */

    public RespEntity deviceSwitchList(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return fireFightingiotJava(jsonParam,"deviceSwitchList","switch");
    }

    /**
     * @Author YangYu
     * @Description 开关新增、编辑
     * @Date Created in 17:14 2022/10/10
     * @Param [jsonParam]
     */

    public RespEntity deviceSwitchAddOrUpdate(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return fireFightingiotJava(jsonParam,"deviceSwitchAddOrUpdate","switch");
    }

    /**
     * @Author YangYu
     * @Description 开关删除
     * @Date Created in 17:14 2022/10/10
     * @Param [jsonParam]
     */

    public RespEntity deviceSwitchDel(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return fireFightingiotJava(jsonParam,"deviceSwitchDel","switch");
    }

    /**
     * @Author YangYu
     * @Description 开关详情
     * @Date Created in 17:14 2022/10/10
     * @Param [jsonParam]
     */

    public RespEntity deviceSwitchDetail(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return fireFightingiotJava(jsonParam,"deviceSwitchDetail","switch");
    }
}
